package com.example.testrecorder.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.testrecorder.R;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Yingyong Lao
 * 创建时间 2021/5/27 21:29
 * @version 1.0
 */
public class IssueFiledAdapter extends BaseAdapter {
    private List<String> list=new ArrayList<>();

    public IssueFiledAdapter(List<String> list) {//构造器
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        String s = list.get(position);
        View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.issue_field_item, parent,false);
        TextView tv=itemView.findViewById(R.id.tv);
        tv.setText(s);
        return itemView;
    }
}
